render.test.js ➔ ... ➔ ???   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
c 2
b 0
f 0
nc 1
dl 0
loc 1
rs 10
nop 0
1
'use strict'
2
const path = require('path')
3
const cons = require('consolidate')
4
const middleware = require('../')
5
6
test('should render the templates correctly', (done) => {
7
  const req = {}
8
  const res = {}
9
  const next = () => {}
10
11
  const opts = {
12
    engine: cons.pug,
13
    dir: path.join(__dirname, '../example')
14
  }
15
16
  middleware(opts)(req, res, next)
17
18
  res.render('view.pug', { name: 'nameless' }, (error, html) => {
19
    expect(error).toBeNull()
20
    expect(html).toEqual('<p style="color:red">nameless</p>')
21
    done()
22
  })
23
})
24